/**
 * windows linux中
 * __dirname的表达方式不一样
 * 程序可能存在兼容性问题
 */
console.log(__dirname);
console.log(__filename);

var filePath ="";

var platForm = process.platform;
switch(platForm){
    case"win32":
        filePath = __dirname + "\\view\\index.html";
        break;
    case"linux":
        filePath = __dirname + "/view/index.html";
        break;
    default:
        console.log("操作系统未知");
        break;
}
console.log(filePath);

/**
 * nodeJS有关文件路径兼容性的解决方案
 * var path = require("path");
 * var str = path.jion(__dirname,"/view/index.html")
 */

var path = require("path");
var pathStr = path.join(__dirname,"/view/index.html");
console.log(pathStr);
